Cyclic Ordering is NP-Complete

نویسندگان

  • Zvi Galil
  • Nimrod Megiddo
چکیده

The cyclic ordering problem is to recognize whether a collection of cyclically ordered triples of elements of a set T is derived from an arrangement of all the elements of T on a circle. This problem is shown to be NP-complete. A cyclic ordering of a set T = {l,. ., t ) is essentially an arrangement of the elements of T on a circle. A specific definition is as follows (see [4]). Two linear orders, (a, , . . . , a , ) and (b,, . . ., b,), on T are called cyclically equivalent if there exists a number q, 1 S q S t, such that ,u 1 = (v 1 -k q ) (mod t ) implies a, = b,. A cyclic ordering of T is an equivalence class of linear orders on T modulo cyclic equivalence; the equivalence class containing (a , , . . ., a,) will be denoted by a , a 2 . . a,. Cyclic ordering is the following recognition problem. The input is a set A of cyclically ordered triples (abbreviated COT's) out of T. The property to be recognized is: There is a cyclic ordering of T from which all the COT's in A are derived; A is called consistent if it has this property. Evidence for the hardness of cyclic ordering was given in r4]. On the other hand, the linear analogue of this problem is known to be easy. Specifically, the property that a set of ordered pairs out of T is derived from a linear order on T, is recognizable in linear time (see [3, Section 2.2.31). Our goal here is to prove that cyclic ordering is NP-complete'. Our problem is obviously in NP since it requires not more than polynomial time to verify that a set of COT's is derived from a certain cyclic ordering. In the remainder of the paper we shall show that satisfiability with at most 3 literals per clause (abbreviated ST3) is *The first author was partially supported by Bath Sheva Fund. ' The reader is assumed to be familiar with NP-completeness and related topics (see [1,2]); the notation for satisfiability is taken from (21. 180 Z. Galil, N. Megiddo reducible to cyclic ordering. This will imply, by definition, that cyclic ordering is NP-complete. The input of ST3 consists of clauses x, v y, v z , ( v = I , . . ., p) where {xu, y,, z,} C U = { u , , . . ., u,, u l , . . ., u,}. Without loss of generality assume that if x, E {u,, fi,), y, E {u,, i i , } and zV € {uk, i lk} then i < j < k . With each u, (7 = 1,. . ., r ) we associate a COTa&y,, and with ii, we associate the reverse COTa,y$,. Let A = {a , , p , , y,, . . . ,a, , pr, y,}. It is assumed that the set A has exactly 3r distinct elements. With each clause x v y v z ({x , y, z } C U) we associate a set A " of COT's as follows. Suppose that abc, def, ghi, are the COT's associated with x, y, 2, respectively ({a , b, c, d, e, f , g, h, i } C A ) . Let B = { j , k , I , m , n } be such that A fl B = 0 and assume that the B,-s that correspond to the various clauses x,, v y, v z , are I pairwise disjoint. Let A" = {acj, bjk, ckl, dfj, ejl, flm, gik, hkm, imn, n m l } . Lemma 1. Let S C U be such that u, E S if and only if u,e S. Let x v y v z be any clause. Let A be a set of COT's defined as follows. Every element of A' (the set of COT's associated with x v y v z ) belongs to A ; the COT's associated with the elements of { x , y, z} \ S belong to A ; if a p y is a COT associated with an element of { x , y,z} fl S then a y p belongs to A. Then, S f l { x , y , z } # 0 if and only if A is consistent. Proof. (Only if) The following table proves that A is consistent whenever s ~ { X , Y , Z I Z P ) . s ~ ( X , Y , Z ) A Every element of A is derived from { x } A" U {acb, def, ghi} {Y A" U {abc, dfe, ghi) ( 2 1 A" U {abc, def, gih) {x, Y 1 A" U {acb, dfe, ghi} {x, 21 A" U {acb, def, gih) {Y, 2 ) A" U {abc, dfe, gih} {x, Y , 2 1 A" U {acb, dfe, gih} ackmbdefjlnghi abcjkdmflneghi abcdefjklngimh ackmbdfejlnghi ackmbdefjlngih abcjkdmflnegih acbjkdmflnegih (If) Notice that if S f l { x , y, z ) = 0 then A = A " U {abc, def, ghi}. Thus, it is sufficient to show that A ' U {abc, def, ghi} is inconsistent which would be a contradiction. To that end, consider the following chains of implications: Cyclic ordering is NP-complete acl hl k ckl abc bcj cjk jkl, gik h k m 8mn ghi hik ikm kmn, llm k m n jkl--+ klm + lmn. These are interpreted as follows. Let C be any cyclic ordering of {a, b, c, . . ., n ) from which all the elements of A are derived. Thus, if abc is also derived from C then necessarily (since acj is derived from C ) bcj is derived from C, and this implies that cjk is derived from C (since bjk is derived from C ) , etc. It can be observed that if every element in A U {abc, def, ghi) is derived from C, then lmn is derived from C. However, this is absurd since nml E A ' . Thus, A0 U {abc, def, ghi} is inconsistent and the proof is complete. Corollary 2. Let S be as in Lemma 1. For every v (v = 1, . . ., p ) let A, denote the set A that corresponds to the clause x, v y , v 2,. Under these conditions, S n {x,, y,, 2,) 0 for v = 1 , . . ., p if and only if A U . . . U A, is consistent. Proof. The "if" part is immediate from Lemma 1. We shall prove the "only if" part. It follows from the "only if" part of Lemma 1 that each A, is derived from a cyclic ordering C, of the set of elements appearing in the COT'S of A,. We claim that there is a cyclic ordering Ctr of the set A such that the restriction of each C, to elements of A is derived from C,,. Specifically, this cyclic ordering of A is 8162 . . . S3, where ( L 2 , L l , S3r) = (ar, &, 7,) if UT E S and ( L 2 , &, , S3,) = (a,, A,, p,) if u, E S. This follows from our choice of the ordering of variables in each clause, the specific orderings shown in our table, and the fact that u, E S &Sf S. Since the B,-s are pairwise disjoint and none of them intersects A, it follows that Co can be extended to a cyclic ordering C of A U B 1 U . . . U B, such that every COT of A U . . . U A, is derived from C. Theorem 3. Let A 0, denote the set A associated with the clause x, v y, v z , (V = 1,. . . ,p ) . Then the conjunction (xl v y, v 2,) A . . . A (x, v y, A z,) is satisfiable if and only if the set A U . . . U A o, is consistent. . Proof. (Only if) If the conjunction is satisfiable then, by definition, there exists an S C U such that u, E S U,Sf S and S n {x,, y,,, z y } # 0 for v = 1, . . . , p . Corollary 2 implies that A :' U . . . U A is consistent. (If) Suppose that A: U . . . U A is consistent and let C be an appropriate cyclic ordering of A U B , U . . . U B,. Let S C U be the set of all x E U such that the C O T which is associated with x is not derived from C. Obviously, u, E S eJ U,ff S. 182 Z. Galil, N. Megiddo Furthermore, it follows from Lemma 1 that for every v ( v = 1,. . . , p ) S fl {x,, y,, 2 , ) # 8, since not all the COT's associated with x,, y,, z , are derived from C. This proves that the conjunction is satisfiable. 0 We have thus reduced ST3 to cyclic ordering. Note that for ST3 with p clauses the corresponding cyclic ordering has not more than lop COT's.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An Algebra for Cyclic Ordering of 2D Orientations

We define an algebra of ternary relations for cyclic ordering of 2D orientations. The algebra (1) is a refinement of the CYCORD theory; (2) contains 24 atomic relations, hence 224 general relations, of which the usual CYCORD relation is a particular relation; and (3) is NP-complete, which is not surprising since the CYCORD theory is. We then provide: (1) a constraint propagation algorithm for t...

متن کامل

An Algebra for Cyclic Ordering of 2 D

We deene an algebra of ternary relations for cyclic ordering of 2D orientations. The algebra (1) is a reene-ment of the CYCORD theory; (2) contains 24 atomic relations, hence 2 24 general relations, of which the usual CYCORD relation is a particular relation; and (3) is NP-complete, which is not surprising since the CYCORD theory is. We then provide: (1) a constraint propagation algorithm for t...

متن کامل

Qualitative Spatial Reasoning a la Allen: An Algebra for Cyclic Ordering of 2D Orientations

We define an algebra of ternary relations for cyclic ordering of 2D orientations, which is a refinement of the CYCORD theory . The algebra (1) contains 24 atomic relations, hence 224 general relations, of which the usual CYCORD relation is a particular relation ; and (2) is NP-complete, which is not surprising since the CYCORD theory is . We then provide the following : (1) a constraint propaga...

متن کامل

Qualitative Spatial Reasoning h la Allen: An Algebra for Cyclic Ordering of 2D Orientations

We define an algebra of ternary relations for cyclic ordering of 2D orientations, which is a refinement of the CYCORD theory. The algebra (1) contains atomic relations, hence 224 general relations, of which the usual CYCORD relation is a particular relation; and (2) is NP-complete, which is not surprising since the CYCORD theory is. We then provide the following: (1) a constraint propagation al...

متن کامل

On random ordering constraints – Revised 14/10/2008

Ordering constraints are analogous to instances of the satisfiability problem in conjunctive normalform, but instead of a boolean assignment we consider a linear ordering of the variables in question. A clause becomes true given a linear ordering iff the relative ordering of its variables obeys the constraint considered. The naturally arising satisfiability problems are NP-complete for many typ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Theor. Comput. Sci.

دوره 5  شماره 

صفحات  -

تاریخ انتشار 1977